package com.wenhuang.chatgptopen.controller;

import com.wenhuang.chatgptopen.pojo.User;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;

/*
 *@Time：2023/6/4
 *@Author：Jelly
 */
public class TestController {
    @RequestMapping("/hello")
    public String hello() {
        System.out.println("hello");

        return "Hello Spring Boot";
    }

    @RequestMapping("/simpleParam")
    public String simpleParam(String name,Integer age){
        System.out.println("name = " + name);
        System.out.println("age = " + age);

        return "ok1";
    }

    @RequestMapping("/simplePojo")
    public String simplePojo(User user){
        System.out.println("user = " + user);

        return "ok2";
    }

    @RequestMapping("/arrayParam")
    public String arrayParam(String[] hobby) {
        System.out.println("hobby = " + hobby);
        System.out.println("Arrays.toString(hobby) = " + Arrays.toString(hobby));

        return "ok3";
    }
}
